package cn.sciento.farm.devicemanager.api.jsonrpc;

import cn.sciento.farm.devicemanager.dao.entity.DevInsectSituationLamp;
import cn.sciento.farm.devicemanager.dao.model.ResponseMessage;
import cn.sciento.farm.devicemanager.gateway.model.downlink.InsectLampSwitchData;
import cn.sciento.farm.devicemanager.gateway.model.downlink.InsectLampConfigData;
import com.googlecode.jsonrpc4j.JsonRpcMethod;
import com.googlecode.jsonrpc4j.JsonRpcService;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 虫情灯
 * @author Walton
 * @since 2020/8/19 9:38
 */
@JsonRpcService("rpc/hardware.insect.situation.lamp")
public interface DevInsectSituationLampJsonApi {

    ResponseMessage insert(DevInsectSituationLamp insectLamp);

    ResponseMessage update(DevInsectSituationLamp insectLamp);

    ResponseMessage getById(Long id);

    ResponseMessage list(Integer areaId);

    ResponseMessage deleteById(Long id);

    @JsonRpcMethod("get_history")
    ResponseMessage getHistory(Integer modbusAddr,Long time);

    @JsonRpcMethod("set_phtots_ratio")
    ResponseMessage setPhtotsRatio(Long id, Integer ratio);

    @JsonRpcMethod("control_switch")
    ResponseMessage controlSwitch(InsectLampSwitchData insectLampSwitchData);

    @JsonRpcMethod("status_refresh")
    ResponseMessage statusRefresh(Long id);

    @JsonRpcMethod("config_insect_lamp")
    ResponseMessage configInsectLamp(InsectLampConfigData insectLampConfigData);

    @JsonRpcMethod("param_refresh")
    ResponseMessage paramRefresh(Long id);

    @JsonRpcMethod("get_image_info")
    ResponseMessage getPhtotsImages(Long id,Long time);

    @JsonRpcMethod("discern_phtots_image")
    ResponseMessage discernPhtotsImage(String imageUrl);

}
